//------------------------------------------------------------------------
// Overview
//------------------------------------------------------------------------
 
This stationery project is designed to get you up and running
quickly with CodeWarrior for MobileGT. It is set up
for a particular evaluation board, but can be easily modified
to target custom hardware.  The hardware specific changes that
you may need to make include hardware initialization code, 
and linker command file for memory map settings.

The project has "Debug Version" and "Cache Version" targets.
It is designed to get you started coding fast and debugging your code
in RAM with or without Instruction Cache enabled from initialization file.
The project's main function contains printf calls (which don't 
produce any output without having the system calls support) and a call 
to an AXE IFA function. 
The project also contains an interrupt vector table.
 
//------------------------------------------------------------------------
// Getting Started
//------------------------------------------------------------------------
 
Most of the target settings are already configured for you if you are
using the evaluation board for that stationery.  From the Edit menu,
select {Target Name} Settings... (Alt+F7). Select the Remote Debugging
pref panel from left column.  Make sure that the correct remote connection
is selected.  We recommend that you make sure the project is working 
properly on your hardware before you begin adding your own code.  Make 
sure your target has power and is connected with the selected debug 
protocol.  Select Debug from the Project menu.  If everything is working
properly, the debugger window should come up and be stopped at main().
 
//------------------------------------------------------------------------
// Adding your own code
//------------------------------------------------------------------------
 
Once everything is working as expected, you can begin adding your own code
to the project.  Keep in mind that we provide this as an example of how to
get up and running quickly with CodeWarrior.  There are certainly other 
ways to set up your linker command file or handle interrupts.  Feel free
to modify any of the source provided. 
 

//------------------------------------------------------------------------
// Prerequisites for AXE debugging on MPC5121
//------------------------------------------------------------------------
 
In order to start the debug session on AXE core, it's necessary that the 
target board to be already initialized. This operation can be done by 
launching a debug session using the MPC5121 stationery project for the e300 
core or by using an u-boot software to initialize the board.

//------------------------------------------------------------------------
// AXE Default memory map on MPC5121
//------------------------------------------------------------------------
The AXE core uses the following memory map:

0x00000000 - 0x00001FFF - AXE I-RAM - instruction memory (used for writing the interrupt table)
0x00000000 - 0x00001FFF - AXE Memory Mapped Registers - data memory

0x00001FFF - 0x08000000 - instruction and data memory mapped in DDR
0x30000000 - 0x30020000 - instruction and data memory mapped in SRAM

The memory map used by the AXE stationery project can be changed from 
the lcf.x file attached to this project.
Please make sure that AXE and e300 shared memories are used correctly by the 
two applications running in parallel on each core.

//------------------------------------------------------------------------
// CodeWarrior Debugger Console I/O
//------------------------------------------------------------------------

Steps to activate debugger console I/O for AXE core:

1. Add the "axe_syscall.a" AXE syscall library.
The file can be found in: \SNE_ABI\SystemCallSupport\Lib\axe_syscall.a.
2. Activate support for system services from "System Call Service Settings" panel. 

The executable will print the "Welcome to CodeWarrior!" message in a CodeWarrior
console I/O window. 
 
Notes: 
------
1. Cygwin has to be available in order to use the integrated AXE build tools.

2. In order to use the AXE debugger on MPC5121, the multi-core debugging core 
index must be unchecked or set to 0 in the project settings. To do that please
select Remote Debugging preference panel.

3. The "Reset Target on Launch" option from  the connection settings dialog must 
be checked in order to allow AXE Debugger to control the AXE core from reset.

4. AXE debugger needs an 8 bytes memory buffer in order to be able to hit 
breakpoints and to read and write the FXP registers. The memory buffer start address 
must be specified in the TAP Memory Buffer edit box from the connection settings 
dialog. If you don't need to change this address you can use the default memory buffer
value set to 0x3001FFF8, at the end of SRAM.

5. When downloading code on the target for the first time
it is recommended to check the "Verify Memory Writes" option in the AXE
Debugger settings preference panel. This is necessary to make sure that the 
board was correctly initialized and the code was downloaded correctly in RAM.
If everything works fine, uncheck the option.


//------------------------------------------------------------------------
// Contacting Freescale
//------------------------------------------------------------------------
You can contact us via email, newsgroups, voice, fax or the 
CodeWarrior website.  For details on contacting Freescale, visit 
http://www.freescale.com/codewarrior, or refer to the front of any 
CodeWarrior manual.
 
For questions, bug reports, and suggestions, please use the email 
report forms in the Release Notes folder.
 
For the latest news, offers, and updates for CodeWarrior, browse
Freescale Worldwide.
 
<http://www.Freescale.com>

